﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;
using NLBS.Entity;

namespace NLBS.Data
{
    public partial class NHibernateDataProvider : DbProvider
    {
        #region WordFilter

        public override IList<WordFilter> GetWordFilter()
        {
            return CurrentSession.CreateCriteria(typeof(WordFilter)).List<WordFilter>();
        }

        public override WordFilter GetWordFilterByID(int itemID)
        {
            return CurrentSession.Get<WordFilter>(itemID);
        }

        public override int InsertWordFilter(WordFilter item)
        {
            CurrentSession.Save(item);
            return item.WordFilterID;
        }

        public override void UpdateWordFilter(WordFilter item)
        {
            CurrentSession.Update(item);
            CurrentSession.Flush();
        }

        public override void DeleteWordFilter(int itemID)
        {
            CurrentSession.Delete(GetWordFilterByID(itemID));
            CurrentSession.Flush();
        }

        #endregion
    }
}
